package kodkod.analysis.visitor;

import java.util.*;
import kodkod.ast.*;

public class IncomingEdges extends IncomingPaths {
	
	private ArrayList<Node> visited = new ArrayList<Node>();

	protected IncomingEdges() {}
	
	public IncomingEdges(Formula formula) {
		this.visit(formula);
	}
	
	@Override
	protected boolean visited(Node n) {
		if (visited.contains(n)) {
			return true;
		} else {
			visited.add(n);
			return false;
		}
	}
}
